package Netzwerkprogrammierung.g2.Sockets;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;

public class UDPServer {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		
		byte[] receiveData = new byte[1024];
		
		DatagramSocket socket = new DatagramSocket(1234);
		
		while(true){
			DatagramPacket receivePacket = 
					new DatagramPacket(receiveData,receiveData.length);
			
			socket.receive(receivePacket);
			
			new UDPServerThread(socket, receivePacket).start();
		}

	}

}
